<template>
	<div>
		<el-form :model="postpone" style="width: 100%;" label-width="80px" ref="menuinfo">
			<ElFormItem prop="MenuName" label="延期原因">
				<ElInput placeholder="请输入你的延期原因" v-model="postpone.Desc"></ElInput>
			</ElFormItem>
			<ElFormItem label="延期时间">
				<el-date-picker placeholder="请选择你的延期时间" type="date" v-model="postpone.PostponeTime"></el-date-picker>
			</ElFormItem>

			<ElFormItem>
				<ElButton @click.prevent="submit" type="primary">提交</ElButton>
			</ElFormItem>
		</el-form>
	</div>
</template>

<script setup lang="ts">
	import taskPostponeapi from '@/api/taskPostponeapi';
	import { ElMessage } from 'element-plus';
	import { ref } from 'vue';

	const props = defineProps({
		Id: Number
	})
	const emits = defineEmits(["CloesDialog"])
	const postpone = ref({
		TaskId: props.Id,
		Desc: "",
		PostponeTime: ""
	});

	const submit = () => {
		console.log("B123=", postpone.value)
		taskPostponeapi.add(postpone.value).then(res => {
			if (res.code > 0) {
				ElMessage.success("成功")
				emits("CloesDialog", "postpone")
			} else {
				ElMessage.error("失败")
			}
		}).catch(err => {
			console.log(err)
		})
	}
</script>

<style scoped>

</style>